package com.maoye.ossp.common.web.taglib;

import java.io.Serializable;
/**
 * 自定义标签Option java类 
 * @author yanghao
 * @date  2014-01-10
 */
public class Option implements Serializable{
	
	private String optionType;
    private String optionName;
    private String optionValue;
    private Integer displayOrder;
	public String getOptionType() {
		return optionType;
	}
	public void setOptionType(String optionType) {
		this.optionType = optionType;
	}
	public String getOptionName() {
		return optionName;
	}
	public void setOptionName(String optionName) {
		this.optionName = optionName;
	}
	public String getOptionValue() {
		return optionValue;
	}
	public void setOptionValue(String optionValue) {
		this.optionValue = optionValue;
	}
	public Integer getDisplayOrder() {
		return displayOrder;
	}
	public void setDisplayOrder(Integer displayOrder) {
		this.displayOrder = displayOrder;
	}
	

    //equals method
    public boolean equals(Object other) {
        if (this == other)
            return true;
        if (!(other instanceof Option))
            return false;

        final Option option = (Option) other;
        if (!this.optionName.equals(option.getOptionName()) ||
                !this.optionType.equals(option.getOptionType()))
            return false;

        return true;
    }

    //hashCode 方法
    public int hashCode() {
        StringBuffer keys = new StringBuffer();
        keys.append(optionName).append(",");
        keys.append(optionType).append(",");
        if (keys.length() > 0)
            keys.deleteCharAt(keys.length() - 1);
        return keys.toString().hashCode();
    }

    //toString 方法
   public String toString() {
			return "Option [optionType=" + optionType + ", optionName="
					+ optionName + ", optionValue=" + optionValue
					+ ", displayOrder=" + displayOrder + "]";
		}

}
